package com.eastfair.venueservice.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.eastfair.boot.mapper.SuperMapper;
import com.eastfair.venueservice.entity.EvaluateComplaint;
import com.eastfair.venueservice.vo.EvaluateComplaintVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * 评价投诉记录
 * </p>
 *
 * @author lyw
 * @date 2023-02-03
 */
@Repository
public interface EvaluateComplaintMapper extends SuperMapper<EvaluateComplaint> {

    /**
     * 展会id统计评星数量.
     *
     * @param queryWrapper the query wrapper
     * @return the list
     */
    List<Map<String, Object>> countEvaluateScoreByExhibitionId(@Param(Constants.WRAPPER) QueryWrapper<EvaluateComplaint> queryWrapper);

    /**
     * 展会ID统计评价或未评价服务数量.
     *
     * @param queryWrapper the query wrapper
     * @return the long
     */
    Long countEvaluateServiceItemByExhibitionId(@Param(Constants.WRAPPER) QueryWrapper<EvaluateComplaint> queryWrapper);

    /**
     * 查询评价服务.
     *
     * @param queryWrapper the query wrapper
     * @return the list
     */
    List<EvaluateComplaintVO> listEvaluateServiceByExhibitionId(@Param(Constants.WRAPPER) QueryWrapper<EvaluateComplaint> queryWrapper);

    /**
     * 展会ID统计各个服务的星级.
     *
     * @param queryWrapper the query wrapper
     * @return the list
     */
    List<EvaluateComplaintVO> countServiceScoreByExhibitionId(@Param(Constants.WRAPPER) QueryWrapper<EvaluateComplaint> queryWrapper);

    /**
     * 查询主场服务的评价数量.
     *
     * @param queryWrapper the query wrapper
     * @return the list
     */
    List<EvaluateComplaintVO> countHomeServiceEvaluate(@Param(Constants.WRAPPER) QueryWrapper<EvaluateComplaint> queryWrapper);
}
